package com.ctrip.ec.biz.dao.activity;
import com.ctrip.ec.dal.DaoBase;
import com.ctrip.ec.biz.entity.activity.ActivityImageEntity;
import com.ctrip.ec.dal.DbAccess;
import org.springframework.beans.propertyeditors.ClassArrayEditor;
import org.springframework.stereotype.Service;

import java.sql.SQLException;
import java.util.List;

@Service
public class ActivityImageDao extends DaoBase<ActivityImageEntity> {
    public ActivityImageDao() {
        super(ActivityImageEntity.class);
    }
    public ActivityImageDao(DbAccess db) {
        super(ActivityImageEntity.class,db);
    }

    public List<ActivityImageEntity> listByActivityId(Long activityId) throws SQLException {
        String sql = "select * from " + this.getTableName() + " where activity_id=?";
        List<ActivityImageEntity> list = this.db.query(ActivityImageEntity.class,sql,activityId);
        return list;
    }
}
